﻿using System;
using fastCSharp;

namespace diantou.web.user
{
    /// <summary>
    /// 用户首页
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsReferer = false)]
    partial class index : view<index>
    {
        /// <summary>
        /// 用户动态
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private userItem[] sends;
        /// <summary>
        /// 用户首页动态
        /// </summary>
        /// <param name="userId">用户标识</param>
        /// <param name="page">分页号</param>
        /// <returns>是否成功</returns>
        private bool loadView(int userId, int page)
        {
            if (base.load(userId))
            {
                diantou.dataAccess.user.send[] values = diantou.dataAccess.tcpCall.user.getSend(userId, pageInfo.Size = fastCSharp.config.pub.Default.PageSize, pageInfo.Page = page, out pageInfo.Count);
                sends = values.getArray(value => new userItem { Item = value, User = currentUser });
                if (requestHeader.IsSearchEngine) pageInfo.Path = user.Path.Index.ToPageString();
                return true;
            }
            return false;
        }
    }
}
